package com.shelpe.services.sinbad.dto;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat.Shape;
import com.shelpe.services.sinbad.entity.jpa.User;

import lombok.Data;

@Data
public class UserViewDto {

	private String nick;
	@JsonProperty("user_id")
	private long userID;
	@JsonFormat(shape = Shape.STRING, pattern = "yyyy-MM-dd HH:mm", timezone = "Asia/Shanghai")
	@JsonProperty("purchase_time")
	private Date purchaseTime;
	
	private long mobile;

	public void from(User po) {
		this.nick = po.getNick();
		this.userID = po.getUserID();
		this.purchaseTime = po.getPurchaseTime();
	}
}
